Data Visualisation with leaflet and plotly

The Data

This analysis uses the City of Cape Town street people dataset. The data can be found here

The dataset is based on interviews conducted with homeless people and captures various demographics relating to their age, race, occupation etc

EDA

## 'data.frame':    5844 obs. of  21 variables:
##  $ Object.ID                               : num  291 292 293 294 295 296 297 298 299 300 ...
##  $ ID                                      : Factor w/ 3818 levels "111","112","113",..: 1803 1814 1821 1822 1837 1838 1840 1841 1790 1791 ...
##  $ Capturer                                : Factor w/ 5 levels "Charlynn","Device",..: 4 4 4 4 4 4 4 4 4 4 ...
##  $ Date                                    : Factor w/ 9 levels "11/5/2015","12/5/2015",..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ Page                                    : num  58 58 58 58 58 58 58 42 58 58 ...
##  $ Grid                                    : Factor w/ 525 levels "AE32","AH31",..: 122 122 122 122 109 109 109 109 109 109 ...
##  $ Gender                                  : Factor w/ 2 levels "Female","Male": 2 2 2 2 2 2 2 2 2 2 ...
##  $ Age                                     : Factor w/ 7 levels "<18","18-25",..: 3 3 5 3 4 3 4 4 4 3 ...
##  $ Race                                    : Factor w/ 5 levels "Asian","Black African",..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ What.is.the.person.doing                : Factor w/ 5 levels "Job Seeker","Sitting",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Job.Seeker.versus.Living.on.the.street  : Factor w/ 2 levels "Job Seeker","Living and Sleeping on the street": 1 1 1 1 1 1 1 1 1 1 ...
##  $ Group                                   : Factor w/ 2 levels "No","Yes": 2 2 2 2 2 2 2 2 1 1 ...
##  $ Number.of.people.in.the.group           : num  8 8 8 8 8 8 8 8 1 1 ...
##  $ Where.was.the.person.sleeping..observed.: Factor w/ 18 levels "Abandoned Building",..: 11 11 11 11 11 11 11 11 11 11 ...
##  $ Street.Name                             : Factor w/ 808 levels "10Th Avenue",..: 708 708 708 708 708 708 708 708 707 707 ...
##  $ Area                                    : Factor w/ 245 levels "Adriaanse","Airlie",..: 205 205 205 205 205 205 205 205 205 205 ...
##  $ X...............GPS.Co.ordinate         : num  18.5 18.5 18.5 18.5 18.5 ...
##  $ Y..................GPS.Co.ordinate      : num  -33.9 -33.9 -33.9 -33.9 -33.9 ...
##  $ Planning.Suburb                         : Factor w/ 296 levels "ANNANDALE","ARAUNA",..: 244 244 244 244 244 244 244 244 244 244 ...
##  $ Ward                                    : num  4 4 4 4 4 4 4 4 4 4 ...
##  $ Subcouncil                              : Factor w/ 22 levels "Subcouncil 1",..: 1 1 1 1 1 1 1 1 1 1 ...

Street People by Location

First we will show the location of all the people encountered in the survey. The people are grouped into clusters to give a high level view which can then be drilled down. A rectangle is drawn to show the geographic area covered by the survey.

Street People by Gender

The next map shows the gender and number of street people per location with the group size indicated by circle radius. Two different colours are used to distinguish between male and females.

christopher barkhuizen

02/07/2019